home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-13 / amac44a.zip / BOK001.QM < prev    next >
Text File  |  1992-06-22  |  44KB  |  814 lines

  1. *                               bok001.qm
  2. *             Macros To Jump to and Load Macros Across Files
  3. *                        Written By Tom Hogshead
  4. *                       [ See BOOKxx.QM For Use ]
  5. *                                 6/22/92
  6. *  Key    Subfile              Description
  7. * =====  ============  ==================================================
  8. *  @f                  - Jump To and Read Macros Across Files  ( )        |chg
  9. *  @p                  - Decrypt @f
  10. *
  11. *  @6                  - Read/Load Txtfile from Index                     |chg
  12. *  @7                  - Read Macros from Index, Txtfile Not Loaded       |chg
  13. *
  14. *  @8                  - Read/Load Macros at Cursor Line Across Files     |chg
  15. *  @9                  - Read Macros at Cursor Line, Txtfile Not Loaded   |chg
  16. *
  17. *  @eq  @=             - Read Current Txtfile's Macros
  18. *
  19. *  @7  {e:\up\fil001}  - Load File Name at Cursor That Is or Is Not
  20. *                        Enclosed with Any Single Characters
  21. *                        or Followed by any Single Trailing Character
  22. *
  23. *      {e:\up\BOOK*}   - Return to BOOKxx.QM
  24. *
  25. *                        Decrypt @f - How to
  26. *                        Run, How to run @f
  27. *                        Index Modification and Additions
  28. *
  29. *-- eoi
  30.  
  31.  
  32. *                            M A C R O S
  33. * ----------------------------------------------------------------------
  34. * @(6)    Select Txtfile To Load And Read Macros From Index
  35. * ----------------------------------------------------------------------
  36. * This macro enables the user to select a txtfile, load the selected
  37. * txtfile, and read the selected txtfiles' macros, from files listed in
  38. * INDXxx.QM.  To run, press @6, cursordown to the desired line in
  39. * INDXxx.QM, and press <enter>.  If the Index subfile selected itself
  40. * has subfile(s), the user may select the desired subfile at the next
  41. * pause by placing the cursor on the desired line and pressing <enter>.
  42. * The macro ends with the final selected txtfile loaded and it's macros
  43. * read.
  44.  
  45. * Add the two closewindow lines at end of macro if QConfig is
  46. * configured to not close window on quit.
  47.  
  48. * w Key in starting file if NO subfile selected
  49. * y Key in starting file if    subfile selected
  50. * y Subfile prefix of index selection
  51. * z Subfile prefix if index selection is macro file , ',qm' extension
  52.  
  53. @6  macrobegin
  54.         setscreenoff
  55.     * -------------------- Load INDX*.QM In Ring --------------------*
  56.         onewindow unmarkblock           * Close all windows
  57.         dropanchor dropanchor           * Mark starting file to return to  *|1
  58.         editfile                        * Load INDX*.QM
  59.                                         *************************************
  60.             "e:\up\"                    * Change "e:\up\" to your directory *
  61.                                         *************************************
  62.             "INDX*.QM"                  *
  63.              return                     *
  64.         quit                            * Quit INDX* if loaded to ensure
  65.                                         * correct Pos in ring
  66.         gotoblockend                    * Return to starting point         *|1
  67.         editfile return                 * Load INDX*.QM as next file in ring
  68. *-- from @5 May 30, 1992
  69.     START:
  70. *         SETSCREENOFF                                                     *|4
  71.         defaultwordset onewindow begfile
  72.         endline unmarkblock dropanchor
  73.         storescrbuff "w" return         * Clear buffers
  74.         storescrbuff "x" return
  75.         storescrbuff "y" return
  76.         storescrbuff "z" return
  77.         unmarkblock markline markline   * Highlight line 1
  78.         FIND "(" return delline return  * Pos on first macro
  79.         makectrofscreen
  80.         begline cursorright             * Pos for visibilty
  81.         SETSCREENON pause SETSCREENOFF  * Pause for selection
  82.         unmarkblock begline markline
  83.         Find "{" return "L" return      * Test if selection has subfile
  84.     jtrue SUBFILE                       * If "{" found, macro is in subfile
  85.     * ---------- Jump to Index Selection If In Current File ----------*
  86.         wordright markword
  87.         storescrbuff "w" return copy    * Store/Copy key
  88.         endpara                         * Bypass Index
  89.         Find
  90.         "(" paste ")" return "I" return * Jump to key in this file
  91.     jfalse NOMARK
  92.         maketopofscreen
  93.         scrollup begline                * Pos cursor line 2 tof
  94.     * ------------------------ NUL Control 1 ------------------------*
  95.         horizontalwindow
  96.         editfile "NUL" return           * Load NUL window 2
  97.         prevwindow                      * Starting file window 1
  98.     jump END1                           * Test if file has macros
  99. *   NOMARK: begfile                     * If no key found, go to bof
  100.     NOMARK: QUIT                        * Quit INDX if no key/subfil       *|1
  101.     jump END3                           * And end macro
  102.     * ---------- Determine if Index Selection Is In Subfile ----------*
  103.     SUBFILE:
  104.         wordleft markword               * Mark subfile key                 *|2
  105.         storescrbuff "x" return         * Store key in buff x
  106.         wordright                       * Return to first char of subf nam *|3
  107.         unmarkblock markcharacter
  108.         Find "}" return delline return  * Mark subfile prefix
  109.         storescrbuff "y" return copy    * Store/copy subfile prefix
  110.         QUIT                            * Quit INDX* and selected subfile  *|1
  111.     * ------------------------- Load Subfile -------------------------*
  112.         prevfile                        * Will return us to starting file :20
  113.         horizontalwindow
  114.         editfile paste ".qm" return     * Load subfile window 2
  115.     * ------------------------ NUL Control 2 ------------------------*
  116.     NEXT:
  117.         horizontalwindow
  118.         editfile "NUL" return           * Load NUL window 3
  119.         getscrbuff "x" return cut       * Cut key to scrap
  120.     * --------------- Find Index Selection In Subfile ---------------*
  121.         prevwindow begfile endpara      * Window subfile, Bypass Index
  122.         Find
  123.         "(" paste ")" return "I" return * Find key in subfile
  124.     jfalse START                        * In case subfile has keys
  125.         maketopofscreen
  126.         scrollup begline                * Pos cursor line 2 tof
  127.     * -------------- Determine if File Contains Macros --------------*
  128.     END1:
  129.         FindReplace #254 return         * Initialize FindReplace
  130.         currentfilename return escape   * w/currentfilename
  131.         nextwindow
  132.         endfile addline cursorright     * Window  Nul
  133.         dropanchor #254 begline         * Insert dummy char
  134.         FindReplace return return
  135.         "N" return                      * Replace dummy w/file name
  136.         Find
  137.         ".qm" return delline return     * Test if file has macros
  138.     jtrue END2                          * Read macros if txtfile
  139.     * --------- Quit NUL, Initialize Find for F4 RepeatFind ---------*
  140.         getscrbuff "w" return cut       *ELSE Cut key to scrap
  141.         Find
  142.         "(" paste ")" return escape     * Initialize for F4 repeatfind
  143.         quit zoomwindow                 * Quit NUL, close window if    
  144. *       closewindow                     * Add if QConfig set to NOT close
  145.                                         *                   window on quit
  146.     jump END3                           * End macro
  147.     END2:
  148.         storescrbuff "z" return         * Store file prefix
  149.         getscrbuff   "w" return cut     * Cut key to scrap
  150.         Find
  151.         "(" paste ")" return escape     * Initialize for F4 repeatfind
  152.         getscrbuff   "z" return cut     * Cut file prefix to scrap
  153.         quit zoomwindow                 * Quit NUL, close window if set to
  154. *       closewindow                     * Add if QConfig set to NOT close
  155.                                         *                   window on quit
  156.     * ------------------------- Read Macros -------------------------*
  157.         SETSCREENON                     * In case macfile does not exist,
  158.                                         * must be able to see dialog boxes
  159.         macroread paste "mac" return    * Read current txtfile macros
  160.     END3:
  161. *
  162. * 198 bytes Mon  07-29-1991  10:24:51 (TH @6, Initial in AMAC39A)
  163. * 298 bytes Fri  08-02-1991  14:59:35 (TH @6, added macrowrite)
  164. * 304 bytes Mon  04-06-1992  08:48:40 (TH @6, added setscreenoff/on)
  165. *                 (In Amac43.zip)
  166. * 302 bytes Sun  05-31-1992  09:18:50 (TH @6, used @f algorithm,
  167. *                                             removed macrowrites *|1)
  168. * 287 bytes Wed  06-03-1992  13:54:50 (TH @6, changed key mark *|2)
  169. * 286 bytes Wed  06-03-1992  21:40:18 (TH @6, shortened *|3)
  170. * 285 bytes Thu  06-04-1992  09:17:53 (TH @6, removed setscreenoff *|4 )
  171. * 284 bytes Thu  06-04-1992  09:47:25 (TH @6, removed prevfile *|5)
  172. * 285 bytes Sat  06-20-1992  13:13:17 (TH @6, addded prevfile *:20)
  173.  
  174.  
  175. * 
  176. * ----------------------------------------------------------------------
  177. * @(7)    Select And Read Macros From Index, Txtfile Not Loaded
  178. * ----------------------------------------------------------------------
  179. * This macro enables the user to select and read a txtfiles' macros
  180. * from files listed in INDXxx.QM, and return to the file in which @7
  181. * was invoked with the newly loaded macros.  The txtfile of macros
  182. * selected is NOT loaded.  To run, press @7, cursordown to the desired
  183. * line in INDXxx.QM, and press <enter>.  If the subfile selected itself
  184. * has subfile(s), the user may select the desired subfile at the next
  185. * pause by placing the cursor on the desired line and pressing <enter>.
  186. * The macro ends with the file loaded in which @7 was invoked, and the
  187. * selected macros read and loaded.
  188.  
  189. * Add the two closewindow lines at end of macro if QConfig is
  190. * configured to not close window on quit.
  191.  
  192. @7  macrobegin
  193.         setscreenoff
  194.     * -------- Clear Scratch Buffers, Position Files In Ring --------*
  195.         onewindow                       * Close all windows
  196.         defaultwordset                  * In case altwordset on
  197.         endline                         * Pos on empty space
  198.         unmarkblock dropanchor          * Mark starting file to clear scratch
  199.                                         * buffers and return to after "quit"
  200.         storescrbuff "x" return         * Clear buff x
  201.         editfile                        * Load INDX*.QM
  202.                                         *************************************
  203.             "e:\up\"                    * Change "e:\up\" to your directory *
  204.                                         *************************************
  205.             "INDX*.QM"                  *
  206.              return                     *
  207.         quit                            * Quit INDX*.QM if loaded to ensure
  208.                                         * correct Pos in ring
  209.         gotoblockend                    * Return to starting point         *|1
  210.     * ------------------------ INDX Selection ------------------------*
  211.         editfile return                 * Load INDX as next file in ring
  212.         begfile                         * Go to file begin
  213.         markline markline               * Highlight line 1
  214.         FIND "{" return delline return  * Find first Index selection line
  215.         makectrofscreen                 * Show top of file
  216.         begline                         * Pos for selection
  217.         cursorright                     * Pos for visibilty
  218.         setscreenon
  219.         pause                           * Pause for Index selection
  220.         setscreenoff
  221.         unmarkblock                     * Unmark line 1
  222.         markline                        * Mark selected line
  223.         FIND "(" return "L" return      * Test if selection has key
  224.  jfalse NOKEY                           * If no key, must be subfile selec
  225.         cursorright                     *ELSE put cursor on key
  226.         markword                        * Mark key
  227.         storescrbuff "x" return         * Store key to buff x
  228.  NOKEY:                                 *
  229.         begline                         * For Find
  230.         markline                        * Markline for Find
  231.         Find "{" return "L" return      * Move cursor to subfile lft brace
  232.  jtrue SELECT                           * If no subfile, quit and end
  233.         quit                            * Quit INDX
  234.  jump END                               * End macro
  235.  SELECT:
  236.         cursorright                     * Move to first letter of subfile
  237.         unmarkblock                     * Unmark
  238.         markcharacter                   * Begin character block
  239.         Find "}" return delline return  * Mark subfile prefix
  240.         copy                            * Copy subfile prefix to scrap
  241.         quit                            * Quit INDX11
  242.     * --------------------- Setup Subfile Window ---------------------*
  243.         horizontalwindow                * Window 2
  244.         editfile escape                 * For all QConfig's
  245.     * ------------------------- NUL Control -------------------------*
  246.         horizontalwindow                * Window 3
  247.         editfile "NUL" return           * Load NUL in window 3
  248.         getscrbuff "x" return           * Get INDX key from scratch
  249.         endline                         * Test if INDX selection had key
  250.  jtrue QUIT                             * If no key, go to QUIT
  251.     * ------------------- Subfile Index Selection -------------------*
  252.         prevwindow                      * Window 2 subfile
  253.         editfile paste ".qm" return     * Load subfile window 2
  254.         begfile                         * Go to file begin
  255.         markline markline               * Highlight line 1
  256.         FIND "{" return delline return  * Test if selection has any subfiles
  257.                                         * If so, Pos cursor on first line
  258.  jfalse QUITNUL                         * If not, read current file macros
  259.         begline cursorright             * Pos for selection
  260.         zoomwindow                      * Full window
  261.         makectrofscreen                 * Show top of file
  262.         setscreenon
  263.         pause                           * Pause for Index selection
  264.         setscreenoff
  265.         unmarkblock                     * Unmark line 1
  266.         markline                        * Mark selected line
  267.         Find return "L" return          * Test if selection has subfile
  268.  jfalse QUITNUL                         * If not, read current file macros
  269.         cursorright                     * Move to first letter of subfile
  270.         unmarkblock                     * Unmark
  271.         markcharacter                   * Begin character block
  272.         Find "}" return delline return  * Mark subfile prefix
  273.         copy                            * Copy subfile prefix to scrap
  274.     * --------------------------- Quit NUL ---------------------------*
  275.  QUITNUL:
  276.         quit                            * Quit subfile, closes window if
  277.                                         *  QConfig set to close on quit
  278. *       closewindow                     * Add this line if QConfig set
  279.                                         *  to NOT close window on quit
  280.         nextwindow                      * Window NUL
  281.  QUIT:
  282.         quit                            * Quit NUL, closes window if
  283.                                         *  QConfig set to close on quit
  284. *       closewindow                     * Add this line if QConfig set
  285.                                         *  to NOT close window on quit
  286.     * ------- Save Current Macro Buffer, Read Selected Macros -------*
  287.  READ:                                  *
  288.         unmarkblock                     * Unmark line if marked
  289.         prevwindow                      * Return to starting file if
  290.                                         *  any window still open
  291.         zoomwindow                      * Full subfile window if
  292.                                         *  any window still open
  293. *-- Load macro text file option, May 31, 1992
  294. *       editfile paste return           * Load macro text file option      *|1
  295.         setscreenon
  296.         macroread                       * Read subfile macros
  297.             paste                       *  of subfile prefix
  298.             ".mac" return               *  w/extension 'mac'
  299.  END:                                   *
  300. *
  301. * 136 bytes Mon  07-29-1991  10:24:57 (TH @7, Initial in AMAC39A)
  302. * 256 bytes Fri  08-02-1991  14:59:02 (TH @7, added macrowrite)
  303. * 249 bytes Sat  08-03-1991  15:45:28 (TH @7, added macrowrite)
  304. * 248 bytes Sun  08-04-1991  01:41:24 (TH @7, removed unmarkblock)
  305. *                 (In Amac40.zip)
  306. * 248 bytes Mon  08-05-1991  00:50:00 (TH @7, moved zoomwindow down)
  307. * 248 bytes Mon  08-05-1991  14:24:16 (TH @7, moved makectrofscreen down)
  308. * 254 bytes Mon  04-06-1992  08:49:08 (TH @7, added setscreenoff/on)
  309. *                 (In Amac43.zip)
  310. * 195 bytes Sun  05-31-1992  10:12:18 (TH @7  removed macrowrites,
  311. *                                             added load selection option,
  312. *                                             changed start *|1)
  313. *
  314.  
  315. * 
  316. * ----------------------------------------------------------------------
  317. * @(8)   Jump From Cursor Line To Macro or Item Located Anywhere
  318. *        In Current File Or In A Designated Subfile, Read Macros
  319. * ----------------------------------------------------------------------
  320. * @8 is used to quickly jump from the cursor line, not the Index line
  321. * like @f, to the desired item or macro either in the current file or
  322. * in a subfile whose name appears in { } following the key or item in
  323. * ( ).  This is useful when the macro key and/or subfile name are on the
  324. * cursor line.  The user then does not have to select the desired macro
  325. * or item from the Index, saving time.  See @f for discussion because
  326. * @8 is installed and used just like @f.  For example, to locate @f
  327. * place the cursor on the following line and invoke @8:
  328.  
  329. *               @f Jump From Index Line To Macro (Example only)
  330.  
  331. @8 macrobegin
  332.         SETSCREENOFF
  333.         defaultwordset
  334.     jump BEGIN                                                             *|1
  335.     START:
  336.         onewindow
  337.         begfile
  338.         endline unmarkblock dropanchor
  339.         storescrbuff "w" return         * Clear buffers
  340.         storescrbuff "x" return
  341.         storescrbuff "y" return
  342.         storescrbuff "z" return
  343.         unmarkblock markline markline   * Highlight line 1
  344.         FIND "(" return delline return  * Pos on first macro
  345.         makectrofscreen
  346.         begline cursorright             * Pos for visibilty
  347.         SETSCREENON pause SETSCREENOFF  * Pause for selection
  348.     BEGIN:
  349.         unmarkblock begline markline
  350.         Find "{" return "L" return      * Test if selection has subfile
  351.     jtrue SUBFILE                       * If "{" found, macro is in subfile
  352.     * ---------- Jump to Index Selection If In Current File ----------*
  353.     INFILE:                             *ELSE, macro is in this file
  354.         wordright markword
  355.         storescrbuff "w" return copy    * Store/Copy key
  356.         begfile                                                            *|1
  357.         endpara                         * Bypass Index
  358.         Find
  359.         "(" paste ")" return "I" return * Jump to key in this file
  360.     jfalse NOMARK
  361.         maketopofscreen
  362.         scrollup begline                * Pos cursor line 2 tof
  363.     * ------------------------ NUL Control 1 ------------------------*
  364.         horizontalwindow
  365.         editfile "NUL" return           * Load NUL window 2
  366.         prevwindow                      * Starting file window 1
  367.     jump END1                           * Test if file has macros
  368.     NOMARK: begfile                     * If no key found, go to bof
  369.     jump END3                           * And end macro
  370.     * --------- Get Subfile Key and Name to Scratch Buffers ---------*
  371.    SUBFILE:
  372.         wordleft markword               * Mark subfile key if it exists
  373.         storescrbuff "x" return         * Store key in buff x
  374.         wordright                       * Return to first char of subf nam
  375.         unmarkblock markcharacter
  376.         Find "}" return delline return  * Mark subfile prefix
  377.         storescrbuff "y" return copy    * Store/copy subfile prefix
  378.     * ------------------------- Load Subfile -------------------------*
  379.         horizontalwindow
  380.         editfile paste ".qm" return     * Load subfile window 2
  381.     * ------------------------ NUL Control 2 ------------------------*
  382.     NEXT:
  383.         horizontalwindow
  384.         editfile "NUL" return           * Load NUL window 3
  385.         getscrbuff "x" return cut       * Cut key to scrap
  386.     * --------------- Find Index Selection In Subfile ---------------*
  387.         prevwindow begfile endpara      * Window subfile, Bypass Index
  388.         Find
  389.         "(" paste ")" return "I" return * Find key in subfile
  390.     jfalse START                        * In case subfile has keys
  391.         maketopofscreen
  392.         scrollup begline                * Pos cursor line 2 tof
  393.     * -------------- Determine if File Contains Macros --------------*
  394.     END1:
  395.         FindReplace #254 return         * Initialize FindReplace
  396.         currentfilename return escape   * w/currentfilename
  397.         nextwindow
  398.         endfile addline cursorright     * Window  Nul
  399.         dropanchor #254 begline         * Insert dummy char
  400.         FindReplace return return
  401.         "N" return                      * Replace dummy w/file name
  402.         Find
  403.         ".qm" return delline return     * Test if file has macros
  404.     jtrue END2                          * Read macros if txtfile
  405.     * --------- Quit NUL, Initialize Find for F4 RepeatFind ---------*
  406.         getscrbuff "w" return cut       *ELSE Cut key to scrap
  407.         Find
  408.         "(" paste ")" return escape     * Initialize for F4 repeatfind
  409.         quit zoomwindow                 * Quit NUL, close window if set to
  410. *       closewindow                     * Add if QConfig set to NOT close
  411.                                         *                   window on quit
  412.     jump END3                           * End macro
  413.     END2:
  414.         storescrbuff "z" return         * Store file prefix
  415.         getscrbuff   "w" return cut     * Cut key to scrap
  416.         Find
  417.         "(" paste ")" return escape     * Initialize for F4 repeatfind
  418.         getscrbuff   "z" return cut     * Cut file prefix to scrap
  419.         quit zoomwindow                 * Quit NUL, close window if set to
  420. *       closewindow                     * Add if QConfig set to NOT close
  421.                                         *                   window on quit
  422.     * ------------------------- Read Macros -------------------------*
  423.         SETSCREENON                     * In case macfile does not exist,
  424.                                         * must be able to see dialog boxes
  425.         macroread paste "mac" return    * Read current txtfile macros
  426.     END3:
  427. *
  428. * 215 bytes Sat  09-07-1991  18:19:08 (TH @9)
  429. * 217 bytes Mon  04-06-1992  08:59:48 (TH @9 added setscreenoff/on)
  430. *                     (In Amac43.zip)
  431. * 159 bytes Sun  05-31-1992  19:04:15 (TH @9, removed macrowrites
  432. *                                             changed key @9 to @8)
  433. * 155 bytes Wed  06-03-1992  22:39:53 (TH @8, *|f)
  434. * 249 bytes Thu  06-04-1992  09:12:58 (TH @8), modified @5 for @8 *|1)
  435.  
  436.  
  437. * 
  438. * ----------------------------------------------------------------------
  439. * @(9) Read Macros of Subfile on Cursor Line, Txtfile Not Loaded
  440. * ----------------------------------------------------------------------
  441. * This macro enables the user to read macros of the subfile designated
  442. * on the cursor line but not load it's txtfile.  If the subfile on the
  443. * cursor line itself has subfile(s), the user may select the desired
  444. * subfile at the next pause by placing the cursor on the desired line
  445. * and pressing <enter>.  If the starting cursor line does not contain a
  446. * designated subfile, the macro ends with the macro buffer unchanged
  447. * and cursor on the starting line in col 1.  In all cases, the txtfile
  448. * of selected macro is NOT loaded and the user is returned to the file
  449. * @8 was invoked from with selected macros loaded.
  450.  
  451. * Add the two closewindow lines at end of macro if QConfig is
  452. * configured to not close window on quit.
  453.  
  454. @9  macrobegin
  455.         setscreenoff
  456.     * -------- Clear Scratch Buffers, Position Files In Ring --------*
  457.         onewindow                       * Close all windows
  458.         unmarkblock                     * Unmark any marked blocks
  459.         defaultwordset                  * In case altwordset on
  460.         endline                         * Pos on empty space
  461.         dropanchor                      * Mark starting file to clear scratch
  462.                                         * buffers and return to after "quit"
  463.         storescrbuff "1" return         * Clear buff 1
  464.         begline                         * Pos for selection
  465.         markline                        * Mark selected line
  466.         find "(" return "L" return      * Test if selection has key
  467.  jfalse NOKEY                           * If no key, must be subfile selec
  468.         cursorright                     *ELSE put cursor on key
  469.         markword                        * Mark key
  470.         storescrbuff "1" return         * Store key to buff 1
  471.  NOKEY:                                 *
  472.         begline                         * For Find
  473.         markline                        * Markline for Find
  474.         find "{" return "L" return      * Move cursor to subfile lft brace
  475.  jtrue SELECT                           * If subfile, continue
  476.         unmarkblock                     *ELSE unmark line
  477.  jump END                               * And end macro, no macro to read
  478.  SELECT:
  479.         cursorright                     * Move to first letter of subfile
  480.         unmarkblock                     * Unmark
  481.         markcharacter                   * Begin character block
  482.         Find "}" return delline return  * Mark subfile prefix
  483.         copy                            * Copy subfile prefix to scrap
  484.         begline                         * Col 1
  485.     * --------------------- Setup Subfile Window ---------------------*
  486.         horizontalwindow                * Window 2
  487.         editfile escape                 * Needed for all QConfig's
  488.     * ------------------------- NUL Control -------------------------*
  489.         horizontalwindow                * Window 3
  490.         editfile "NUL" return           * Load NUL in window 3
  491.         getscrbuff "1" return           * Get key from buff 1
  492.         endline                         * Test if selection had key
  493.  jtrue QUIT                             * If no key, go to QUIT
  494.     * ------------------- Subfile Index Selection -------------------*
  495.         prevwindow                      * Window 2 subfile
  496.         editfile paste ".qm" return     * Load subfile window 2 to test if
  497.                                         *  it has subfiles
  498.         begfile                         * Go to file begin
  499.         markline markline               * Highlight line 1
  500. *         zoomwindow                      * Full window
  501.         FIND "{" return delline return  * Test if selection has any subfiles
  502.                                         * If so, Pos cursor on first line
  503.  jfalse QUITNUL                         * If not, read current file macros
  504.         begline                         * Pos for selection
  505.         cursorright                     * Pos for visibilty
  506.         zoomwindow                      * Full window
  507.         makectrofscreen                 * To show top of file
  508.         setscreenon
  509.         pause                           * Pause for Index selection
  510.         setscreenoff
  511.         unmarkblock                     * Unmark line 1
  512.         markline                        * Mark selected line
  513.         Find return "L" return          * Test if selection has subfile
  514.  jfalse QUITNUL                         * If not, read current file macros
  515.         cursorright                     * Move to first letter of subfile
  516.         unmarkblock                     * Unmark
  517.         markcharacter                   * Begin character block
  518.         Find "}" return delline return  * Mark subfile prefix
  519.         copy                            * Copy subfile prefix to scrap
  520.         begline
  521.     * --------------------------- Quit NUL ---------------------------*
  522.  QUITNUL:
  523.         quit                            * Quit subfile, closes window if
  524.                                         *  QConfig set to close on quit
  525. *       closewindow                     * Add this line if QConfig set
  526.                                         *  to NOT close window on quit
  527.         nextwindow                      * Window NUL
  528.  QUIT:
  529.         quit                            * Quit NUL, closes window if
  530.                                         *  QConfig set to close on quit
  531. *       closewindow                     * Add this line if QConfig set
  532.                                         *  to NOT close window on quit
  533.     * ------- Save Current Macro Buffer, Read Selected Macros -------*
  534.  READ:                                  *
  535.         prevwindow                      * Return to starting file
  536.         zoomwindow                      * Full subfile window
  537.         setscreenon
  538.         macroread                       * Read subfile macros
  539.             paste                       *  of subfile prefix
  540.             ".mac" return               *  w/extension 'mac'
  541.  END:                                   *
  542. *
  543. * 198 bytes Sun  08-04-1991  01:53:24 (TH @8)
  544. * 200 bytes Mon  08-05-1991  01:06:52 (TH @8, added missing endline)
  545. * 204 bytes Mon  04-06-1992  08:49:38 (TH @8, added setscreenoff/on)
  546. *                 (In Amac43.zip)
  547. * 146 bytes Sun  05-31-1992  19:01:16 (TH @8, removed macrowrites,
  548. *                                             changed key @8 to @9 *|b)
  549.  
  550.  
  551.  
  552. * 
  553. * ----------------------------------------------------------------------
  554. * @= Read Current Txtfile's Macros                            @(eq)ual
  555. * ----------------------------------------------------------------------
  556. * Installing this macro in QConfig.dat, enables the user to read the
  557. * macros of the current file we are editing.
  558.  
  559. @= Macro_Begin MacroRead CurrentFilename Backspace Backspace "mac" Return
  560. *
  561. * 15 bytes Fri  09-14-1990  14:06:11 (TH @=, @8 in MACRxx.QM)
  562.  
  563. * 
  564. * ----------------------------------------------------------------------
  565. * @(f)   Jump From Index Line To Macro or Item Located Either
  566. *        In Document Below Or In A Designated Subfile
  567. * ----------------------------------------------------------------------
  568. * The first commented lines of this macro must be decrypted to run.
  569. * See @p at the end of this file for decryption instructions.
  570.  
  571. * @f is used to quickly jump from Index line to the desired item
  572. * or macro either in the document below or in a subfile whose
  573. * name appears in { } following the key or item in ( ).  @f uses
  574. * a technique that is generally not recommended and rarely
  575. * works, i.e.  "having a macro read another macro".  This is
  576. * possible here because the macroread command is the last
  577. * command in the macro.  This macro requires QEdit and QMAC
  578. * v2.15.
  579.  
  580. * @f provides the user with a means to quickly load any macro in
  581. * an Index with just several keystrokes.  The number of macros
  582. * that can be accessed and run using this macro is theoretically
  583. * unlimited; e.g., if no macro subfile of all those designated
  584. * in the Index contains more than 10 macros and an Index with
  585. * key and subfile contains a list of 1000 macros, each of these
  586. * macros could be assigned @1 to @0 in each subfile, and we
  587. * could access and run 1000 macros using only the keys @1 to @0
  588. * from one Index with just several keystrokes.  Another
  589. * advantage using @f is that an addition or modification to a
  590. * specific macro only modifies the subfile containing the macro
  591. * and it's macfile, thereby reducing considerably the size of
  592. * files needing backed up or uploaded when changes are made.
  593.  
  594. * The techniques used in @f become useful and/or necessary when
  595. * the total size of macros in a file exceed the 2k limitation or
  596. * when the number of macros in a file are greater than 40 and
  597. * the user (like me!) prefers to use only the Alternate Number
  598. * keys and "@^#" Function keys.  The same macro key may be used
  599. * for different macros in different subfiles in the same Index,
  600. * allowing the convenient Alternate Number keys to be used for
  601. * all macros in all subfiles, unless the number of macros in any
  602. * subfile of an Index is greater than 10.  In other words, we
  603. * don't run out of keys!
  604.  
  605. * The user may wish to add or delete items from an (Index).  An
  606. * item or macro located in the same file as the Index, not in a
  607. * subfile, must have the key or first word enclosed with
  608. * parentheses ( ), and an item or macro located in another file
  609. * (referred to as "subfile") must have the subfile prefix
  610. * enclosed with braces { } following the macro key, as follows:
  611.  
  612. *                           INDEX
  613. * ============================================================
  614. * ( Key ) { Subfile }   ...........  Description ............
  615.  
  616. * All subfile suffix's must be "QM", and all macfile suffix's
  617. * must be "MAC".  If the designated subfile does not have a
  618. * corresponding macfile, the selected item will be found in the
  619. * subfile anyhow, and an error message will be displayed
  620. * advising "File Not Found" meaning the subfile does not have a
  621. * corresponding macfile.  Escape removes the message and shows
  622. * the name of the non-existent subfile macfile.  Escape again
  623. * returns us to normal editing of the subfile with the same
  624. * macro buffer as before @f was executed - no problems.
  625.  
  626. * If the selected key or first word on the selected Index line
  627. * does not exist enclosed by ( ) anywhere in the document (or in
  628. * the subfile if designated), the cursor returns to the
  629. * beginning of the file.
  630.  
  631. * At the pause, @f positions the cursor line on the first left
  632. * parentheis.  If the key (or first word) in the index line is not
  633. * enclosed with a ( ), which it does need to, you may want to insert a
  634. * ( ) at the end of the first index line.
  635.  
  636. * If your QConfig is set to NOT close windows on quit, add the
  637. * lines 'closewindow' commented out in @f.
  638.  
  639. * To (Run) @f
  640. * -----------
  641. * 1.  Press Alt and f at the same time.  Line 1 is marked to highlight.
  642. *     Cursor down to desired line in Index.
  643.  
  644. * 2.  Press Enter.  The macro then locates and jumps to the item
  645. *     selected on the cursor line.  If the item or macro is located in
  646. *     a designated subfile, @f loads the subfile containing the
  647. *     selected macro, and reads the subfile macros for running.  The
  648. *     selected macro key and it's macro are found and shown in a full
  649. *     window for editing or viewing.
  650.  
  651. * 
  652. @f macrobegin
  653. *--
  654. * NOTE:  The first lines of this macro must be decrypted to run.  See
  655. *        @p at the end of this file and READ.ME for instructions.
  656. *--
  657.         SETSCREENOFF                                                       *|1
  658.         defaultwordset                                                     *|
  659.     START:
  660. *-- begin of encrypt
  661. *ö°ùÅÜÇùéüεö⌠Åâ≡ÇÄÅöτùé±ÇùÅöÉù∩φäÆ⌠ÄüΘÆöΦäü·ñùΘåüäöà÷üäÅàΘäÿßëëö"ε"
  662. *öïÅ÷ßäùöà÷üäÅàΘäÿßëëö"æ"öïÅ÷ßäùöà÷üäÅàΘäÿßëëö"Σ"öïÅ÷ßäùöà÷üäÅàΘäÿßëë
  663. *ö"Ñ"öïÅ÷ßäùöÉù∩φäÆ⌠ÄüΘÆö≤φäƱÇùÅö≤φäƱÇùÅö≡Çùéö"("öïÅ÷ßäùöΦÅıÇùÅ
  664. *öïÅ÷ßäùö≤φÆŵ÷ä°ëàΘäÅÅùö⌠Åâ±ÇùÅöµßäÖüäïÇâå÷
  665. *-- end of encrypt
  666.     BEGIN:
  667.         unmarkblock begline markline
  668.         Find "{" return "L" return      * Test if selection has subfile
  669.     jtrue SUBFILE                       * If "{" found, macro is in subfile
  670.     * ---------- Jump to Index Selection If In Current File ----------*
  671.     INFILE:                             *ELSE, macro is in this file
  672.         wordright markword
  673.         storescrbuff "w" return copy    * Store/Copy key
  674.         endpara                         * Bypass Index
  675.         Find
  676.         "(" paste ")" return "I" return * Jump to key in this file
  677.     jfalse NOMARK
  678.         maketopofscreen
  679.         scrollup begline                * Pos cursor line 2 tof
  680.     * ------------------------ NUL Control 1 ------------------------*
  681.         horizontalwindow
  682.         editfile "NUL" return           * Load NUL window 2
  683.         prevwindow                      * Starting file window 1
  684.     jump END1                           * Test if file has macros
  685.     NOMARK: begfile                     * If no key found, go to bof
  686.     jump END3                           * And end macro
  687.     * --------- Get Subfile Key and Name to Scratch Buffers ---------*
  688. * 
  689. * SUBFILE: begline wordright markword   * Mark subfile key
  690. *  jfalse NEXT                          * Bypass buffers if no word to mark
  691.     SUBFILE:
  692.         wordleft markword               * Mark subfile key if it exists    *|1
  693.                                         * If it does not, use fictitous blk
  694.         storescrbuff "x" return         * Store key in buff x
  695.         wordright                       * Return to first char of subf nam *|1
  696. *-- (removed     June 3, 1992)
  697. *       markline begline
  698. *       Find "{" return "L" return      * Test if selection has subfile
  699. *  jfalse NEXT                          * Bypass buffers if no subfile
  700. *         cursorright
  701.         unmarkblock markcharacter
  702.         Find "}" return delline return  * Mark subfile prefix
  703.         storescrbuff "y" return copy    * Store/copy subfile prefix
  704.     * ------------------------- Load Subfile -------------------------*
  705.         prevfile                        *  Will return us to starting file*:20
  706.         horizontalwindow
  707.         editfile paste ".qm" return     * Load subfile window 2
  708.     * ------------------------ NUL Control 2 ------------------------*
  709.     NEXT:
  710.         horizontalwindow
  711.         editfile "NUL" return           * Load NUL window 3
  712.         getscrbuff "x" return cut       * Cut key to scrap
  713.     * --------------- Find Index Selection In Subfile ---------------*
  714.         prevwindow begfile endpara      * Window subfile, Bypass Index
  715.         Find
  716.         "(" paste ")" return "I" return * Find key in subfile
  717.     jfalse START                        * In case subfile has keys
  718.         maketopofscreen
  719.         scrollup begline                * Pos cursor line 2 tof
  720.     * -------------- Determine if File Contains Macros --------------*
  721.     END1:
  722.         FindReplace #254 return         * Initialize FindReplace
  723.         currentfilename return escape   * w/currentfilename
  724.         nextwindow
  725.         endfile addline cursorright     * Window  Nul
  726.         dropanchor #254 begline         * Insert dummy char
  727.         FindReplace return return
  728.         "N" return                      * Replace dummy w/file name
  729.         Find
  730.         ".qm" return delline return     * Test if file has macros
  731.     jtrue END2                          * Read macros if txtfile
  732.     * --------- Quit NUL, Initialize Find for F4 RepeatFind ---------*
  733.         getscrbuff "w" return cut       *ELSE Cut key to scrap
  734.         Find
  735.         "(" paste ")" return escape     * Initialize for F4 repeatfind
  736.         quit zoomwindow                 * Quit NUL, close window if set to
  737. *       closewindow                     * Add if QConfig set to NOT close
  738.                                         *                   window on quit
  739.     jump END3                           * End macro
  740.     END2:
  741.         storescrbuff "z" return         * Store file prefix
  742.         getscrbuff   "w" return cut     * Cut key to scrap
  743.         Find
  744.         "(" paste ")" return escape     * Initialize for F4 repeatfind
  745.         getscrbuff   "z" return cut     * Cut file prefix to scrap
  746.         quit zoomwindow                 * Quit NUL, close window if set to
  747. *       closewindow                     * Add if QConfig set to NOT close
  748.                                         *                   window on quit
  749.     * ------------------------- Read Macros -------------------------*
  750.         SETSCREENON                     * In case macfile does not exist,
  751.                                         * must be able to see dialog boxes
  752.         macroread paste "mac" return    * Read current txtfile macros
  753.     END3:
  754. *
  755. * 196 bytes Fri  10-18-1991  11:04:25 (TH @f, decrypted)
  756. * 166 bytes Fri  10-18-1991  11:08:08 (TH @f, encrypted, in AMAC41.ZIP)
  757. * 265 bytes Mon  02-17-1992  17:22:15 (TH @f, decrypted)
  758. * 227 bytes Mon  02-17-1992  17:21:20 (TH @f, encrypted, in AMAC42.ZIP)
  759. * 261 bytes Mon  04-27-1992  10:11:28 (TH @f, decrypted *|c)
  760. * 220 bytes Mon  05-04-1992  21:44:37 (TH @f, encrypted *|c)
  761. *                 (In Amac43.zip)
  762. * 245 bytes Thu  06-04-1992  09:21:54 (TH @f, changed key mark *|1)
  763. * 246 bytes Sat  06-20-1992  13:15:15 (TH @f, added prevfile *:20)
  764.  
  765.  
  766. * 
  767. * -------------------------
  768. * @(p) (Decrypt) Macro @f
  769. * -------------------------
  770. *         I'll be happy to  send you the Password  to decrypt @f if you
  771. *   will send  me $15.00  (or any amount)  in a  self addressed stamped
  772. *   envelope.  If you don't have $15.00 or don't think these macros are
  773. *   worth it, I'll still  be glad to send  you the Password.  Just send
  774. *   me a  self addressed stamped  envelope anyhow! If  you would rather
  775. *   not lick  two stamps,  use and  enjoy the  other 400+ non-encrypted
  776. *   macros in AMACxx.zip.  My address is:
  777.  
  778. *                        T & T Enterprises
  779. *                           PO Box 10786
  780. *                       Greensboro, NC 27404
  781.  
  782. *       I  hope you  find some of  these  macros useful.   If you are a
  783. *   serious  QEdit user,  I  think you  will.   Thanks for  using Amac.
  784.  
  785.  
  786. * NOTE: To decrypt @f, password for AMAC44.ZIP must be used.
  787.  
  788. @p      Macro_Begin OneWindow GotoBlockBeg JTrue Label0: MarkLine
  789.         GotoBlockBeg JTrue Label1: Pause MarkLine Label0: Label1:
  790.         GotoBlockEnd SetRmargin Return ToggleWordWrap EndLine #173
  791.         BegLine GotoBlockBeg UnmarkBlock EndLine BegLine JTrue
  792.         Label2: NextPara Label2: Label13: MarkColumn EditFile "nul"
  793.         Return Quit GotoBlockBeg HorizontalWindow EditFile Return "A"
  794.         "BCDEFGHIJKLMNOPQRSTUVWXYZ" DupLine MarkLine Lower UnmarkBlock
  795.         CursorUp CursorRight JoinLine ShiftRight CursorUp "152436097"
  796.         "8" AddLine BegLine CursorRight "Ωφ∩Θñ⌠µΦτ≡ô⌡≈σ∙±≤≥°δìïàòÉîÜ¢£"
  797.         "¥₧ƒáíóúαêèöÿéÅëâåÇçÆÄùü·ûäÖ÷ßΓεæΣÑ" EndFile AddLine BegLine
  798.         Pause Label5: CursorLeft JFalse Label3: UnmarkBlock
  799.         MarkColumn Cut Find Paste Return "G" Return JFalse Label4:
  800.         DelCh BegLine CursorRight Paste EndFile Jump Label5: Label3:
  801.         DelLine PrevWindow Label11: MarkColumn Copy NextWindow
  802.         Label9: BegFile Find Paste Return DelLine Return JFalse
  803.         Label6: CursorDown JTrue Label7: CursorUp Label7: MarkColumn
  804.         Copy Label6: PrevWindow MakeCtrOfScreen PasteOver UnmarkBlock
  805.         CursorRight EndLine JFalse Label8: PrevPosition MarkColumn
  806.         Copy NextWindow Jump Label9: Label8: Find #173 Return "B"
  807.         Return JTrue Label10: BegLine CursorDown Label12: EndLine
  808.         BegLine JTrue Label11: NextPara Jump Label12: NextWindow Quit
  809.         CloseWindow Jump Label13: Label10: DelCh BegLine CursorDown
  810.         NextWindow Label4: Quit CloseWindow SetRmargin Return
  811. *
  812. * 356 bytes Mon  08-26-1991  02:51:27 (TH @p)
  813.  
  814.